<template>
  <template v-for="(item, index) in dian" :key="index">
    <el-menu-item v-if="!item.children" :index="item.path">
      <template #title>
        <el-icon>
          <component :is="item.meta?.icon" />
        </el-icon>
        <span>{{ item.meta?.title }}</span>
      </template>
    </el-menu-item>
    <el-sub-menu v-else :index="item.path">
      <template #title>
        <el-icon>
          <component :is="item.meta?.icon" />
        </el-icon>
        <span>{{ item.meta?.title }}</span>
      </template>
      <zujian :dian="item.children"></zujian>
    </el-sub-menu>
  </template>
</template>

<script setup lang="ts">
import { defineProps } from 'vue'
import type { RouteRecordRaw } from 'vue-router'
import zujian from '@/components/zujian/index.vue'
defineProps<{ dian: RouteRecordRaw[] }>()
</script>

<style lang="scss">
</style>